package com.zhisolution.zhicms.admin;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;
import com.zhisolution.zhicms.model.sys_user;

public class SessionInterceptor implements Interceptor {

	public void intercept(ActionInvocation ai) {
		sys_user sysUser = (sys_user)ai.getController().getSessionAttr("zhicms_sys_user");
		if(sysUser != null){
			ai.invoke();
		}else{
			ai.getController().redirect("/admin");
		}
	}

}
